package kp.rpc.consumer;

import cn.hutool.json.JSONUtil;
import com.kp.rpc.common.model.User;
import com.kp.rpc.common.service.UserService;
import kp.rpc.proxy.ServiceProxyFactory;
import lombok.extern.slf4j.Slf4j;

@Slf4j
public class EasyConsumerExample {
    public static void main(String[] args) {
        // 动态代理
        UserService userService = ServiceProxyFactory.getProxy(UserService.class);
        User user = new User();
        user.setName("test");
        User user1 = userService.getUser(user);
        log.info("收到消息=>{}", JSONUtil.toJsonStr(user1));
        User user2 = userService.getUser(user);
        User user3 = userService.getUser(user);
    }
}
